import router from './index'
// 全局前置守卫
router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = '佰茵云-' + to.meta.title
    console.log(to, from)
  }
  if (to.path == '/login') {
    //保存当前路由
    localStorage.setItem('preRoute', from.fullPath)
  }
  next()
})
// 全局后置守卫
router.afterEach((to, from) => {
  //console.log(to, from)
})
export default router
